<!DOCTYPE html>
<html xmlns:wb="http://open.weibo.com/wb">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection" />
	<meta content="emai=no" name="format-detection" />
	<meta property="wb:webmaster" content="7ae117dc1d8992dc" />
	<title>啪啪蚊子排行榜</title>
	<link href="/wenzi/css/common.css" rel="stylesheet" />
	<link href="/wenzi/css/ranking.css" rel="stylesheet" />
	<script src="/wenzi/js/zepto-1.1.6.js"></script>
	<script src="/wenzi/js/fastclick.js"></script>
	<script src="/wenzi/js/common.js"></script>
	<script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?19f39b206aedf768b42fbc69e4e4f721";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>
	
</head>
<body>
	<div class="ranking-wrapper">
		<header>
			<img src="/wenzi/img/ranking_title.png"/>
			<p class="nav <?php if($type == 1):?>time<?php else:?>count<?php endif?>">
				<img class="time" src="/wenzi/img/ranking_nav1.png" />
				<img class="count" src="/wenzi/img/ranking_nav2.png" />
				<span data-type="time" data-href="/mosquito/top?type=1"></span>
				<span data-type="count" data-href="/mosquito/top?type=2"></span>
			</p>
		</header>
		<table>
			<thead>
				<tr>
					<td class="tab_no">&nbsp;</td>
					<td class="tab_name">&nbsp;</td>
					<?php if($type == 1):?>
					<td class="tab_time">&nbsp;</td>
					<?php else:?>					
					<td class="tab_count">&nbsp;</td>
					<?php endif;?>
				</tr>
			</thead>
			<tbody>
				<?php if($type == 1):?>
				<?php for($i=0; $i<10; $i++):?>
				<tr <?php if($list[$i]['self'] == true):?>class="mine" <?php endif?>>
					<td><?php echo $i+1?></td>
					<td><?php echo $list[$i]['mosquito_nick_name']?></td>
					<td><?php echo $list[$i]['max_time']?>秒</td>
				</tr>
				<?php endfor;?>
				
				<?php if($top_number > 10):?>
				<tr class="ellipse">
					<td>&nbsp;</td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
				</tr>
				<tr class="mine">
					<td><?php echo $top_number?></td>
					<td><?php echo $list[$top_number -1]['mosquito_nick_name']?></td>
					<td><?php echo $list[$top_number -1]['max_time']?>秒</td>
				</tr>
				<?php endif;?>
				
				<?php else:?>
				<!-- 啪了多少下 -->
				<?php for($i=0; $i<10; $i++):?>
				<tr <?php if($list[$i]['self'] == true):?>class="mine" <?php endif?>>
					<td><?php echo $i+1?></td>
					<td><?php echo $list[$i]['mosquito_nick_name']?></td>
					<td><?php echo $list[$i]['total_num']?>个</td>
				</tr>
				<?php endfor;?>
				
				<?php if($top_number > 10):?>
				<tr class="ellipse">
					<td>&nbsp;</td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
				</tr>
				<tr class="mine">
					<td><?php echo $top_number?></td>
					<td><?php echo $list[$top_number -1]['mosquito_nick_name']?></td>
					<td><?php echo $list[$top_number -1]['total_num']?>个</td>
				</tr>
				<?php endif;?>
				
				<?php endif;?>
			</tbody>
		</table>
		<ul class="more-actions clear">
			<li onclick="javascript:alert('活动已结束，快去领奖吧！')"><img src="/wenzi/img/btn_replay.png" alt="再啪一次" /></li>
			<?php if($device == 'wechat'):?>
			<li data-spopup=".share-notice"><img src="/wenzi/img/btn_share.png" alt="炫耀一下" /></li>
			<?php else:?>
			<li data-href="http://service.weibo.com/share/share.php?url=http%3A%2F%2Fwx.zhishimama.com%2Fmosquito%2Findex&type=button&language=zh_cn&appkey=724579473&title=<?php echo urlencode($share_content)?>&&pic=<?php echo urlencode('http://wx.zhishimama.com/wenzi/img/weiboshare.png')?>&searchPic=true&style=simple"><img src="/wenzi/img/btn_share.png" alt="炫耀一下" /></li>
			<?php endif;?>
			<?php if($device == 'wechat'):?>
			<li data-href="http://mp.weixin.qq.com/s?__biz=MzAxMDc3NDM1Mg==&mid=502325165&idx=1&sn=6714a6393b60f134f2c4ed4c9f4fa1c6&scene=1&srcid=0708biggLktgxE7mE6UX2FS2#wechat_redirect"><img src="/wenzi/img/btn_more.png" alt="啪得更久" /></li>
			<?php else:?>
			<li data-href="http://weibo.com/5928035261/DEl67CJPz?from=page_1006065928035261_profile&wvr=6&mod=weibotime"><img src="/wenzi/img/btn_more.png" alt="啪得更久" /></li>
			<?php endif;?>
			
			<li data-href="/mosquito/gift"><img src="/wenzi/img/btn_gift.png" alt="奖品" /></li>
		</ul>
	</div>
	<div class="popup-wrapper share-notice">
		<div class="popup-bg" data-cpopup=".share-notice"></div>
		<div class="popup-layout" data-cpopup=".share-notice">
			<img class="share" src="/wenzi/img/share_notice.png" />
		</div>
	</div>
	<?php if($device == 'wechat'):?>
	<script type="text/javascript">
    Zepto(function ($) {
        wx.config({
            debug: false,
            appId: '<?php echo $js_config['appId']?>',
            timestamp: <?php echo $js_config['timestamp']?>,
            nonceStr: '<?php echo $js_config['noncestr']?>',
            signature: '<?php echo $js_config['signature']?>',
            jsApiList: [
            	'onMenuShareTimeline',
            	'onMenuShareAppMessage'
            ]
        });
        wx.ready(function () {
        	wx.onMenuShareTimeline({
        	    title: '<?php echo $share_content?>', // 分享标题
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	        $.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 2},
        				type: "post",
        				success: function(res){
        					$(".share-notice").hide();
        					$(".share-notice").siblings().removeClass("disableClick");
        					$("body").css("overflow-y", "auto");
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    	$(".share-notice").hide();
        	    	$(".share-notice").siblings().removeClass("disableClick");
        	    	$("body").css("overflow-y", "auto");
        	    }
        	});

        	wx.onMenuShareAppMessage({
        	    title: '<?php echo $share_desc?>', // 分享标题
        	    desc: '<?php echo $share_content?>', // 分享描述
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    type: 'link', // 分享类型,music、video或link，不填默认为link
        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    	$.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 2},
        				type: "post",
        				success: function(res){
        					$(".share-notice").hide();
        					$(".share-notice").siblings().removeClass("disableClick");
        					$("body").css("overflow-y", "auto");
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    	$(".share-notice").hide();
        	    	$(".share-notice").siblings().removeClass("disableClick");
        	    	$("body").css("overflow-y", "auto");
        	    }
        	});
        });
    })
	</script>
	<?php endif;?>
</body>
</html>